package com.rs.statistics.Controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.rs.statistics.dao.ILoginDao;
import com.rs.statistics.model.Users;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

//@Api(tags = "登录模块")
@RestController
@RequestMapping("/users")
public class LoginController {
	@Resource
private ILoginDao logindao;
	@ApiOperation(value = "用户登陆",notes = "根据账号密码登陆用户")
	@PostMapping("login")
	public Users Login(String name,int password) {
		return logindao.findByNameAndPassword(name,password);
		
	}
	@ApiOperation(value = "修改密码",notes = "根据原密码创建新密码")
	@PostMapping("updatepwd")
	public int updatepwd(@RequestBody int id,int password , int pwd) {
		return logindao.updatepwd(id,password,pwd);
	
	}
}
